package com.example;

import cn.hutool.core.thread.ThreadUtil;
import com.example.netty.NettyServer;
import org.springframework.boot.CommandLineRunner;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.scheduling.annotation.EnableScheduling;

@EnableScheduling
@SpringBootApplication
public class DemoApplication implements CommandLineRunner {

    public static void main(String[] args) {
        SpringApplication.run(DemoApplication.class, args);
    }

    @Override
    public void run(String... args) throws Exception {
        ThreadUtil.execute(new Runnable() {
            @Override
            public void run() {
                try {
                  new NettyServer(1234).run();
                }catch (Exception e){
                    e.printStackTrace();

                }
            }
        });
    }

}
